# -*- encoding: utf-8 -*-

'''
@File    :   get_index_daily.py
@Contact :   ypy02784@163.com
@License :   (C)Copyright 2019-2020, ypy

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2020/3/2 22:26   ypy      1.0         None
'''

from stock import models
from django.core import serializers


def index_daily(ts_code):
    """
    查询的ts代码股指数据
    :param ts_code：股指代码
    :return:
    """
    df = models.index_daily.objects.filter(ts_code=ts_code).order_by('-trade_date')[0:100]
    return serializers.serialize("json", df)
